function fetchJSON() {
    var processData = 'JSON';
    $.ajax({
        type: "GET",
        url: "./AjaxServlet",
        data: "processData=" + processData,
        success: function(result) {
            alert("Data type process: " + result.processData +
                  " First Name: " + result.firstName +
                  " Last Name: " + result.lastName)
        },
        error: function(xhr, ajaxOptions, thrownError) {
            alert("Error status code: " + xhr.status);
            alert("Error details: " + thrownError);
        }
    });
}
